Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Add Base Testnet data #284

Merged
merged 11 commits into from
Aug 5, 2024
Merged

chore: Add Base Testnet data #284

merged 11 commits into from
Aug 5, 2024

Conversation

julianrubino
Copy link
Member

@julianrubino julianrubino commented Aug 2, 2024

Summary by CodeRabbit

  • New Features

    • Introduced a new base_testnet configuration with key parameters for enhanced smart contract interactions.
    • Added new blockchain addresses and metadata entries to improve cross-chain functionalities and messaging capabilities within the ecosystem.
    • Expanded the recognized test networks to include base_testnet, providing additional resources for developers.
  • Bug Fixes

    • None
  • Documentation

    • None
  • Tests

    • None
  • Chores

    • None
  • Revert

    • None

Copy link
Contributor

coderabbitai bot commented Aug 2, 2024

Walkthrough

The recent updates enhance the blockchain development landscape by introducing the "base_testnet." This new configuration is integrated into several files, providing essential parameters for smart contract interactions and improving the testing environment. The enhancements focus on flexibility and efficiency for developers, facilitating smoother deployment processes within the blockchain ecosystem.

Changes

File(s) Change Summary
v1/data/addresses.json, v1/data/addresses.testnet.json Added new "base_testnet" section and various entries for blockchain parameters and cross-chain functionalities.
v1/hardhat.config.ts Introduced configuration for "base_testnet," including API key integration and custom chain details.
v1/lib/address.tools.ts, v1/lib/contracts.constants.ts, v1/lib/contracts.helpers.ts Expanded support for "base_testnet" in type declarations, constants, and helper functions.

Sequence Diagram(s)

sequenceDiagram
    participant Developer
    participant Hardhat
    participant BaseTestnet
    participant SmartContracts

    Developer->>Hardhat: Configure base_testnet
    Hardhat->>BaseTestnet: Connect to API
    BaseTestnet->>SmartContracts: Deploy contracts
    SmartContracts-->>BaseTestnet: Confirm deployment
    BaseTestnet-->>Hardhat: Return transaction details
    Hardhat-->>Developer: Provide feedback on deployment
Loading

🐇 In the meadow, bright and free,
A new testnet hops with glee!
With contracts ready, code in hand,
Developers weave a blockchain land.
Base testnet brings a joyous cheer,
For testing futures, far and near! 🌟


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@julianrubino julianrubino changed the title Add Base Testnet chore: Add Base Testnet data Aug 2, 2024
@julianrubino julianrubino marked this pull request as draft August 2, 2024 19:54
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 8c5c55c and e4b1cb0.

Files selected for processing (6)
  • v1/data/addresses.json (1 hunks)
  • v1/data/addresses.testnet.json (1 hunks)
  • v1/hardhat.config.ts (2 hunks)
  • v1/lib/address.tools.ts (1 hunks)
  • v1/lib/contracts.constants.ts (1 hunks)
  • v1/lib/contracts.helpers.ts (1 hunks)
Additional context used
GitHub Check: lint
v1/hardhat.config.ts

[failure] 30-30:
Expected object keys to be in ascending order. 'base_testnet' should be before 'mainnet'


[failure] 41-41:
Insert ⏎······

Gitleaks
v1/data/addresses.json

90-90: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)

Additional comments not posted (12)
v1/lib/contracts.constants.ts (1)

69-74: Verify the appropriateness of default values for base_testnet.

The new entry for base_testnet assigns default values ("0") to several keys. Ensure these values are correct and appropriate for the test network.

v1/hardhat.config.ts (2)

30-30: Ensure the BASESCAN_API_KEY environment variable is set.

The new entry for base_testnet uses process.env.BASESCAN_API_KEY or an empty string. Verify that the environment variable is correctly set in the deployment environment.

Tools
GitHub Check: lint

[failure] 30-30:
Expected object keys to be in ascending order. 'base_testnet' should be before 'mainnet'


41-47: Verify the correctness of chainId and URLs for base_testnet.

The new entry for base_testnet defines chainId, network name, and URLs for the API and browser interfaces. Ensure these values are correct and consistent with the actual test network configuration.

Tools
GitHub Check: lint

[failure] 41-41:
Insert ⏎······

v1/lib/address.tools.ts (2)

38-38: Verify the correctness of the new entry for base_testnet in ZetaProtocolTestNetwork.

The new entry for base_testnet adds it as a recognized test network. Ensure this addition is correct and consistent with other test network entries.


46-46: Verify the correctness of the new entry for base_testnet in zetaProtocolTestNetworks.

The new entry for base_testnet adds it to the list of recognized test networks. Ensure this addition is correct and consistent with other test network entries.

v1/lib/contracts.helpers.ts (1)

32-33: LGTM! But verify the function usage in the codebase.

The code changes are approved.

However, ensure that all function calls to isEthNetworkName are updated to recognize the new network name.

Verification successful

Function usage verified successfully.

The function isEthNetworkName is correctly utilized across the codebase, and the new network name base_testnet is recognized in all relevant places.

  • v1/scripts/tools/update-tss-address.ts
  • v1/scripts/deployments/tools/deterministic-get-salt-zeta-connector.ts
  • v1/scripts/deployments/core/deterministic-deploy-zeta-token.ts
  • v1/scripts/deployments/tools/deterministic-get-salt-zeta-token.ts
  • v1/scripts/deployments/core/deploy-zeta-connector.ts
  • v1/scripts/tools/token-approval.ts
  • v1/scripts/deployments/core/deterministic-deploy-zeta-connector.ts
  • v1/scripts/deployments/core/deploy-zeta-token.ts
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all function calls to `isEthNetworkName` recognize the new network name.

# Test: Search for the function usage. Expect: Only occurrences of the new network name.
rg --type typescript -A 5 $'isEthNetworkName'

Length of output: 79


Script:

#!/bin/bash
# Description: Verify all function calls to `isEthNetworkName` recognize the new network name.

# Test: Search for the function usage in all TypeScript files.
rg 'isEthNetworkName' --glob '*.ts' -A 5

Length of output: 9845

v1/data/addresses.json (1)

85-93: LGTM!

The addition of the base_testnet section is consistent with the existing structure.

Tools
Gitleaks

90-90: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)

v1/data/addresses.testnet.json (5)

385-390: LGTM!

The addition of the base_testnet entries is consistent with the existing structure.


391-397: LGTM!

The addition of the base_testnet entries is consistent with the existing structure.


398-404: LGTM!

The addition of the base_testnet entries is consistent with the existing structure.


405-411: LGTM!

The addition of the base_testnet entries is consistent with the existing structure.


412-417: LGTM!

The addition of the base_testnet entries is consistent with the existing structure.

@CharlieMc0
Copy link
Member

Besides the linter error it looks good to me. I'd like @lumtis to confirm though.

@julianrubino julianrubino marked this pull request as ready for review August 5, 2024 14:53
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Outside diff range, codebase verification and nitpick comments (1)
v1/data/addresses.json (1)

85-85: Add a description for the new section.

Consider adding a brief description or comment for the base_testnet section to provide context for its purpose.

+    // Base Testnet configuration
Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

Commits

Files that changed from the base of the PR and between e4b1cb0 and 76fad57.

Files selected for processing (2)
  • v1/data/addresses.json (1 hunks)
  • v1/hardhat.config.ts (2 hunks)
Files skipped from review as they are similar to previous changes (1)
  • v1/hardhat.config.ts
Additional context used
Gitleaks
v1/data/addresses.json

91-91: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)

Additional comments not posted (6)
v1/data/addresses.json (6)

86-86: Ensure the connector address is correct.

Verify that the connector address 0x6A269Be3e414e4617f01231a2485FB692C53f748 is correct and intended for the base_testnet.


87-87: Ensure the immutableCreate2Factory address is correct.

Verify that the immutableCreate2Factory address 0x095a03c6a68137fE9a566bBc3e552F299d8b886d is correct and intended for the base_testnet.


88-88: Ensure the erc20Custody address is correct.

Verify that the erc20Custody address 0x44e8ED4a36670966C292a21EC15C9E43502d3CB3 is correct and intended for the base_testnet.


89-89: Ensure the tss address is correct.

Verify that the tss address 0x8531a5aB847ff5B22D855633C25ED1DA3255247e is correct and intended for the base_testnet.


90-90: Ensure the tssUpdater address is correct.

Verify that the tssUpdater address 0xdE3fb63723f0EEed8967ff9124e1c3bA89871b03 is correct and intended for the base_testnet.


92-93: Ensure the zetaTokenConsumerUniV2 and zetaTokenConsumerUniV3 fields are correct.

The zetaTokenConsumerUniV2 and zetaTokenConsumerUniV3 fields are currently empty. Verify if this is intentional or if they need to be populated.

v1/data/addresses.json Outdated Show resolved Hide resolved
v1/lib/contracts.helpers.ts Outdated Show resolved Hide resolved
v1/data/addresses.testnet.json Outdated Show resolved Hide resolved
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Outside diff range, codebase verification and nitpick comments (2)
v1/data/addresses.json (1)

85-85: Add a comment to explain the purpose of base_testnet.

Adding a brief comment to explain the purpose and usage of the base_testnet section would improve readability and maintainability.

v1/data/addresses.testnet.json (1)

385-390: Add a comment to explain the purpose of base_testnet.

Adding a brief comment to explain the purpose and usage of the base_testnet section would improve readability and maintainability.

Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 76fad57 and ce9de4b.

Files selected for processing (2)
  • v1/data/addresses.json (1 hunks)
  • v1/data/addresses.testnet.json (1 hunks)
Additional context used
Gitleaks
v1/data/addresses.json

91-91: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)

Additional comments not posted (1)
v1/data/addresses.testnet.json (1)

399-403: Potential API Key exposure.

The address 0xf4e63991E7475b659bd97Bba85f32a7259239D5d in the zetaToken field may be a Generic API Key. Ensure that it is not exposing sensitive information.

- "address": "0xf4e63991E7475b659bd97Bba85f32a7259239D5d"
+ "address": "<secure_value>"

Likely invalid or redundant comment.

v1/data/addresses.json Show resolved Hide resolved
@julianrubino julianrubino requested a review from lumtis August 5, 2024 15:31
Copy link
Member

@lumtis lumtis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@julianrubino julianrubino merged commit 94516b3 into main Aug 5, 2024
7 checks passed
@julianrubino julianrubino deleted the add_base_testnet branch August 5, 2024 21:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants